/***************************************************************************
 *   Copyright (C) 2007 by Grzegorz Latarowski, Maciej Gajewski            *
 *   g.latarowski@gmail.com                                                *
 *   maciej.gajewski0@gmail.com                                            *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

// local
#include "camera1params.h"

// =========================== camera1params =====================
/// Returns list of camera1 params description, mapped by their (formal) name
GParamsDescription camera1Params()
{
	GParamsDescription result;

	// ----------------- PARAM_BGFACTOR	
	GParamDescription bgfactor;
	bgfactor.setName( PARAM_BGFACTOR );
	bgfactor.setReadableName( QObject::tr( "Background update factor" ) );
	bgfactor.setType( QVariant::Double );
	bgfactor.setDefaultValue( QVariant( 0.01 ) );
	bgfactor.setDecimals( 2 );
	bgfactor.setMinimum( 0 );
	bgfactor.setMaximum( 1 );
	bgfactor.setSingleStep( 0.01 );
	
	result.append( bgfactor );
	
	// ----------------- PARAM_FGTRESHOLD
	GParamDescription fgtreshold;
	fgtreshold.setName( PARAM_FGTRESHOLD );
	fgtreshold.setReadableName( QObject::tr( "Foreground treshold" ) );
	fgtreshold.setType( QVariant::Double );
	fgtreshold.setDefaultValue( QVariant( 0.3 ) );
	fgtreshold.setDecimals( 2 );
	fgtreshold.setMinimum( 0 );
	fgtreshold.setMaximum( 1 );
	fgtreshold.setSingleStep( 0.01 );
	
	result.append( fgtreshold );
	
	// ----------------- PARAM_JPEG_INTERVAL
	GParamDescription jpegInterval;
	jpegInterval.setName( PARAM_JPEG_INTERVAL );
	jpegInterval.setReadableName( QObject::tr( "JPG2k sending interval [ms]" ) );
	jpegInterval.setType( QVariant::Int );
	jpegInterval.setDefaultValue( QVariant( 1000 ) );
	jpegInterval.setMinimum( 0 );
	jpegInterval.setMaximum( 1000000 );
	jpegInterval.setSingleStep( 100 );
	
	result.append( jpegInterval );
	
	// ----------------- PARAM_EXPOSURE
	GParamDescription exposure;
	exposure.setName( PARAM_EXPOSURE );
	exposure.setReadableName( QObject::tr( "Exposure [ms]" ) );
	exposure.setType( QVariant::Int );
	exposure.setDefaultValue( QVariant( 60 ) );
	exposure.setMinimum( 0 );
	exposure.setMaximum( 1000 );
	exposure.setSingleStep( 5 );
	
	result.append( exposure );
	
	// ----------------- PARAM_REFERENCE_DISTANCE
	GParamDescription referenceDistance;
	referenceDistance.setName( PARAM_REFERENCE_DISTANCE );
	referenceDistance.setReadableName( QObject::tr( "Reference distance [mm]" ) );
	referenceDistance.setType( QVariant::Int );
	referenceDistance.setDefaultValue( QVariant( 0 ) );
	referenceDistance.setMinimum( 0 );
	referenceDistance.setMaximum( 10000 );
	referenceDistance.setSingleStep( 10 );
	
	result.append( referenceDistance );
	
	// ----------------- PARAM_MAX_SPEED
	GParamDescription maxSpeed;
	maxSpeed.setName( PARAM_MAX_SPEED );
	maxSpeed.setReadableName( QObject::tr( "Maximum allowed speed [m/s]" ) );
	maxSpeed.setType( QVariant::Int );
	maxSpeed.setDefaultValue( QVariant( 20 ) );
	maxSpeed.setMinimum( 0 );
	maxSpeed.setMaximum( 100 );
	maxSpeed.setSingleStep( 1 );
	
	result.append( maxSpeed );
	
	// ----------------- PARAM_MIN_OBJ_SIZE
	GParamDescription minSize;
	minSize.setName( PARAM_MIN_OBJ_SIZE );
	minSize.setReadableName( QObject::tr( "Minimum object size [pixels]" ) );
	minSize.setType( QVariant::Int );
	minSize.setDefaultValue( QVariant( 16 ) );
	minSize.setMinimum( 0 );
	minSize.setMaximum( 1024 );
	minSize.setSingleStep( 8 );
	
	result.append( minSize );
	
	// ----------------- PARAM_MAX_OBJ_SIZE
	GParamDescription maxSize;
	maxSize.setName( PARAM_MAX_OBJ_SIZE );
	maxSize.setReadableName( QObject::tr( "Maximum object size [pixels]" ) );
	maxSize.setType( QVariant::Int );
	maxSize.setDefaultValue( QVariant( 128 ) );
	maxSize.setMinimum( 0 );
	maxSize.setMaximum( 1024 );
	maxSize.setSingleStep( 8 );
	
	result.append( maxSize );
	
	// ----------------- PARAM_JPEG_SIZE
	GParamDescription jpegSize;
	jpegSize.setName( PARAM_JPEG_SIZE );
	jpegSize.setReadableName( QObject::tr( "JPEG2K frame size [kB]" ) );
	jpegSize.setType( QVariant::Int );
	jpegSize.setDefaultValue( QVariant( 4 ) );
	jpegSize.setMinimum( 1 );
	jpegSize.setMaximum( 200 );
	jpegSize.setSingleStep( 1 );
	
	result.append( jpegSize );
	
	// ----------------- PARAM_IMAGEFORMAT
	GParamDescription imageFormat;
	imageFormat.setItem( QObject::tr( "JPEG2000" ),		QVariant( 0 ) );
	imageFormat.setItem( QObject::tr( "Segmented" ),	QVariant( 1 ) );
		
	imageFormat.setName( PARAM_IMAGEFORMAT );
	imageFormat.setReadableName( QObject::tr( "Image format send to client" ) );
	imageFormat.setType( QVariant::String );
	imageFormat.setDefaultValue( imageFormat.items().begin().value() );
	
	result.append( imageFormat );
	
	// ----------------- PARAM_SHOW_ALL_OBJECTS
	GParamDescription showAllObjs;
		
	showAllObjs.setName( PARAM_SHOW_ALL_OBJECTS );
	showAllObjs.setReadableName( QObject::tr( "Show also invalid objects" ) );
	showAllObjs.setType( QVariant::Bool );
	showAllObjs.setDefaultValue( false );
	
	result.append( showAllObjs );

	// ----------------- PARAM_CO_CAMERA_IP
	GParamDescription coCameraIP;

	coCameraIP.setName( PARAM_CO_CAMERA_IP );
	coCameraIP.setReadableName( QObject::tr( "Co-Camera IP number" ) );
	coCameraIP.setType( QVariant::String );
	coCameraIP.setDefaultValue( QString( "10.0.0.56" ) );

	result.append( coCameraIP );
	
	
	return result;
}

// eof
